package com.danbay.framework.kafka.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Role;
import org.springframework.kafka.config.KafkaListenerEndpointRegistry;

/**
 * @author SJG
 *         2017/11/15.
 */
@Configuration
public class KafkaConfiguration {
    public KafkaConfiguration() {
    }

    @Bean(
            name = {"org.springframework.kafka.config.internalKafkaListenerAnnotationProcessor"}
    )
    @Role(2)
    public KafkaListenerBeanPostProcessor kafkaListenerAnnotationProcessor() {
        return new KafkaListenerBeanPostProcessor();
    }

    @Bean(
            name = {"org.springframework.kafka.config.internalKafkaListenerEndpointRegistry"}
    )
    public KafkaListenerEndpointRegistry defaultKafkaListenerEndpointRegistry() {
        return new KafkaListenerEndpointRegistry();
    }
}
